package com.acc.mobileappr.entities;

import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;

/**
 * Created by IntelliJ IDEA.
 * User: user
 * Date: Apr 20, 2011
 * Time: 10:54:48 AM
 * To change this template use File | Settings | File Templates.
 */
public class MstMApprStructureEntityPK implements Serializable {
    private String docId;

    @Id
    @Column(name = "DOC_ID")
    public String getDocId() {
        return docId;
    }

    public void setDocId(String docId) {
        this.docId = docId;
    }

    private String screenName;

    @Id
    @Column(name = "SCREEN_NAME")
    public String getScreenName() {
        return screenName;
    }

    public void setScreenName(String screenName) {
        this.screenName = screenName;
    }

    private String contentId;

    @Id
    @Column(name = "CONTENT_ID")
    public String getContentId() {
        return contentId;
    }

    public void setContentId(String contentId) {
        this.contentId = contentId;
    }

    private String version;

    @Id
    @Column(name = "VERSION")
    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    private String indexOnScreen;

    @Id
    @Column(name = "INDEX_ON_SCREEN")
    public String getIndexOnScreen() {
        return indexOnScreen;
    }

    public void setIndexOnScreen(String indexOnScreen) {
        this.indexOnScreen = indexOnScreen;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        MstMApprStructureEntityPK that = (MstMApprStructureEntityPK) o;

        if (contentId != null ? !contentId.equals(that.contentId) : that.contentId != null) return false;
        if (docId != null ? !docId.equals(that.docId) : that.docId != null) return false;
        if (indexOnScreen != null ? !indexOnScreen.equals(that.indexOnScreen) : that.indexOnScreen != null)
            return false;
        if (screenName != null ? !screenName.equals(that.screenName) : that.screenName != null) return false;
        if (version != null ? !version.equals(that.version) : that.version != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = docId != null ? docId.hashCode() : 0;
        result = 31 * result + (screenName != null ? screenName.hashCode() : 0);
        result = 31 * result + (contentId != null ? contentId.hashCode() : 0);
        result = 31 * result + (version != null ? version.hashCode() : 0);
        result = 31 * result + (indexOnScreen != null ? indexOnScreen.hashCode() : 0);
        return result;
    }
}
